package com.smartcruise.main.selfFragment.setting;

import android.widget.TextView;

import com.smartcruise.R;
import com.smartcruise.base.BaseTitleFragment;
import com.smartcruise.base.TitleBuilder;
import com.smartcruise.util.TempleUser;
import com.smartcruise.util.TimeUtils;

import butterknife.BindView;

/**
 * Created by FengChaoQun
 * on 2018/1/20 0020
 * 个人信息界面
 */

public class SelfInfoFragment extends BaseTitleFragment {
    @BindView(R.id.name)
    TextView name;
    @BindView(R.id.phone)
    TextView phone;
    @BindView(R.id.IC)
    TextView IC;
    @BindView(R.id.belongs)
    TextView belongs;
    @BindView(R.id.registerDate)
    TextView registerDate;

    @Override
    protected void init() {
        setCloseActivity();

        name.setText(TempleUser.getInstance().getUserInfo().getUserName());
        phone.setText(TempleUser.getInstance().getUserInfo().getPhoneNumber());
        IC.setText(TempleUser.getInstance().getUserInfo().getIdNumber());
        belongs.setText(TempleUser.getInstance().getUserInfo().getAddress());
        registerDate.setText(TimeUtils.getSimpleTimeString(TempleUser.getInstance().getUserInfo().getRegisterDate()));
    }

    @Override
    protected int getContentLayout() {
        return R.layout.fragment_contain_self_info;
    }

    @Override
    protected TitleBuilder getTitleBuilder() {
        return TitleBuilder.create(true, getString(R.string.selfInfo));
    }

}
